package com.yoga.service;

import java.util.Calendar;
import java.util.Date;

import com.yoga.db.CardDao;
import com.yoga.entity.CardInfo;

public class YearCardManageService implements CardManageService{
	CardDao dao = new CardDao();

	public int addNewCard() {
		CardInfo card = new CardInfo();
		card.setType('Y');
		
		Date curDate = new Date();
		card.setStartTime(curDate);
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(curDate);
		calendar.add(Calendar.YEAR, 1);
		card.setEndTime(calendar.getTime());
		return dao.addCard(card);
	}
}
